//
//  TestViewController.m
//  MSDemo
//
//  Created by mac on 2021/6/16.
//

#import "TestViewController.h"
#import "SearchViewController.h"
#import "TestViewController1.h"
#import "TestViewController2.h"
#import "TestViewController3.h"
#import "TestViewController4.h"
#import "TestViewController5.h"
#import "TestViewController6.h"
#import "TestViewController7.h"
#import "TestViewController8.h"
#import "TestViewController9.h"
#import "TestViewController10.h"

@interface TestViewController ()


@end

@implementation TestViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn1.backgroundColor = UIColor.redColor;
    [btn1 setTitle:@"录音"
         forState:UIControlStateNormal];
    [btn1 addTarget:self
            action:@selector(didSelectedLuYinButton)
  forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn1];
    [btn1 mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(200 * MS_ADAPTATION_RATIO);
        make.left.mas_equalTo(100 * MS_ADAPTATION_RATIO);
        make.height.mas_equalTo(60 * MS_ADAPTATION_RATIO);
        make.centerX.equalTo(self.view);
    }];
    
    UIButton *btn2 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn2.backgroundColor = UIColor.redColor;
    [btn2 setTitle:@"上传图片/视频 photoView"
         forState:UIControlStateNormal];
    [btn2 addTarget:self
            action:@selector(didSelectedImagePickerButton1)
  forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn2];
    [btn2 mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(btn1.mas_bottom).offset(30 * MS_ADAPTATION_RATIO);
        make.left.mas_equalTo(100 * MS_ADAPTATION_RATIO);
        make.height.mas_equalTo(60 * MS_ADAPTATION_RATIO);
        make.centerX.equalTo(self.view);
    }];
    
    UIButton *btn3 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn3.backgroundColor = UIColor.redColor;
    [btn3 setTitle:@"上传图片/视频 HXPhoto"
         forState:UIControlStateNormal];
    [btn3 addTarget:self
            action:@selector(didSelectedImagePickerButton2)
  forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn3];
    [btn3 mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(btn2.mas_bottom).offset(30 * MS_ADAPTATION_RATIO);
        make.left.mas_equalTo(100 * MS_ADAPTATION_RATIO);
        make.height.mas_equalTo(60 * MS_ADAPTATION_RATIO);
        make.centerX.equalTo(self.view);
    }];
    
    UIButton *btn4 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn4.backgroundColor = UIColor.redColor;
    [btn4 setTitle:@"输入框 UITextField"
         forState:UIControlStateNormal];
    [btn4 addTarget:self
            action:@selector(didSelectedTextFieldButton)
  forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn4];
    [btn4 mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(btn3.mas_bottom).offset(30 * MS_ADAPTATION_RATIO);
        make.left.mas_equalTo(100 * MS_ADAPTATION_RATIO);
        make.height.mas_equalTo(60 * MS_ADAPTATION_RATIO);
        make.centerX.equalTo(self.view);
    }];
    
    UIButton *btn5 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn5.backgroundColor = UIColor.redColor;
    [btn5 setTitle:@"YYLabel+YYTextView"
         forState:UIControlStateNormal];
    [btn5 addTarget:self
            action:@selector(didSelectedYYLabelButton)
  forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn5];
    [btn5 mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(btn4.mas_bottom).offset(30 * MS_ADAPTATION_RATIO);
        make.left.mas_equalTo(100 * MS_ADAPTATION_RATIO);
        make.height.mas_equalTo(60 * MS_ADAPTATION_RATIO);
        make.centerX.equalTo(self.view);
    }];
    
    UIButton *btn6 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn6.backgroundColor = UIColor.redColor;
    [btn6 setTitle:@"update view frame"
         forState:UIControlStateNormal];
    [btn6 addTarget:self
            action:@selector(didSelectedUpdateFrameButton)
  forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn6];
    [btn6 mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(btn5.mas_bottom).offset(30 * MS_ADAPTATION_RATIO);
        make.left.mas_equalTo(100 * MS_ADAPTATION_RATIO);
        make.height.mas_equalTo(60 * MS_ADAPTATION_RATIO);
        make.centerX.equalTo(self.view);
    }];
    
    UIButton *btn7 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn7.backgroundColor = UIColor.redColor;
    [btn7 setTitle:@"富文本编辑器 textEditor"
         forState:UIControlStateNormal];
    [btn7 addTarget:self
            action:@selector(didSelectedTextEditorButton)
  forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn7];
    [btn7 mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(btn6.mas_bottom).offset(30 * MS_ADAPTATION_RATIO);
        make.left.mas_equalTo(100 * MS_ADAPTATION_RATIO);
        make.height.mas_equalTo(60 * MS_ADAPTATION_RATIO);
        make.centerX.equalTo(self.view);
    }];
    
    UIButton *btn8 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn8.backgroundColor = UIColor.redColor;
    [btn8 setTitle:@"搜索"
         forState:UIControlStateNormal];
    [btn8 addTarget:self
            action:@selector(didSelectedSearchButton)
  forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn8];
    [btn8 mas_remakeConstraints:^(MASConstraintMaker *make) {

        make.top.equalTo(btn7.mas_bottom).offset(30 * MS_ADAPTATION_RATIO);
        make.left.mas_equalTo(100 * MS_ADAPTATION_RATIO);
        make.height.mas_equalTo(60 * MS_ADAPTATION_RATIO);
        make.centerX.equalTo(self.view);
    }];

    UIButton *btn9 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn9.backgroundColor = UIColor.redColor;
    [btn9 setTitle:@"EChart"
         forState:UIControlStateNormal];
    [btn9 addTarget:self
            action:@selector(didSelectedEChartButton)
  forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn9];
    [btn9 mas_remakeConstraints:^(MASConstraintMaker *make) {

        make.top.equalTo(btn8.mas_bottom).offset(30 * MS_ADAPTATION_RATIO);
        make.left.mas_equalTo(100 * MS_ADAPTATION_RATIO);
        make.height.mas_equalTo(60 * MS_ADAPTATION_RATIO);
        make.centerX.equalTo(self.view);
    }];
    
    UIButton *btn10 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn10.backgroundColor = UIColor.redColor;
    [btn10 setTitle:@"商品进销存管理"
         forState:UIControlStateNormal];
    [btn10 addTarget:self
            action:@selector(didSelectedDBButton)
  forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn10];
    [btn10 mas_remakeConstraints:^(MASConstraintMaker *make) {

        make.top.equalTo(btn9.mas_bottom).offset(30 * MS_ADAPTATION_RATIO);
        make.left.mas_equalTo(100 * MS_ADAPTATION_RATIO);
        make.height.mas_equalTo(60 * MS_ADAPTATION_RATIO);
        make.centerX.equalTo(self.view);
    }];
    
    UIButton *btn11 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn11.backgroundColor = UIColor.redColor;
    [btn11 setTitle:@"layer实现滑动解锁动画"
         forState:UIControlStateNormal];
    [btn11 addTarget:self
            action:@selector(didSelectedAnimationButton)
  forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn11];
    [btn11 mas_remakeConstraints:^(MASConstraintMaker *make) {

        make.top.equalTo(btn10.mas_bottom).offset(30 * MS_ADAPTATION_RATIO);
        make.left.mas_equalTo(100 * MS_ADAPTATION_RATIO);
        make.height.mas_equalTo(60 * MS_ADAPTATION_RATIO);
        make.centerX.equalTo(self.view);
    }];
    
    UIButton *btn12 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn12.backgroundColor = UIColor.redColor;
    [btn12 setTitle:@"抽奖轮盘"
         forState:UIControlStateNormal];
    [btn12 addTarget:self
            action:@selector(didSelectedDiviedCircleViewButton)
  forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn12];
    [btn12 mas_remakeConstraints:^(MASConstraintMaker *make) {

        make.top.equalTo(btn11.mas_bottom).offset(30 * MS_ADAPTATION_RATIO);
        make.left.mas_equalTo(100 * MS_ADAPTATION_RATIO);
        make.height.mas_equalTo(60 * MS_ADAPTATION_RATIO);
        make.centerX.equalTo(self.view);
    }];
}


#pragma mark - event
/** 录音 */
- (void)didSelectedLuYinButton
{
    TestViewController1 *VC = [[TestViewController1 alloc] init];
    VC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:VC animated:YES];
}
/** 上传图片/视频 HXPhotoView */
- (void)didSelectedImagePickerButton1
{
    TestViewController2 *VC = [[TestViewController2 alloc] init];
    VC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:VC animated:YES];
}
/** 上传图片/视频 HXPhoto */
- (void)didSelectedImagePickerButton2
{
    TestViewController3 *VC = [[TestViewController3 alloc] init];
    VC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:VC animated:YES];
}
/** 输入框 */
- (void)didSelectedTextFieldButton
{
    TestViewController4 *VC = [[TestViewController4 alloc] init];
    VC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:VC animated:YES];
}
/** YYLabel */
- (void)didSelectedYYLabelButton
{
    TestViewController5 *VC = [[TestViewController5 alloc] init];
    VC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:VC animated:YES];
}
/** 更新 view frame  */
- (void)didSelectedUpdateFrameButton
{
    TestViewController6 *VC = [[TestViewController6 alloc] init];
    VC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:VC animated:YES];
}
/** 富文本编辑器 */
- (void)didSelectedTextEditorButton
{
    TestViewController7 *VC = [[TestViewController7 alloc] init];
    VC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:VC animated:YES];
}
/** 搜索 */
- (void)didSelectedSearchButton
{
    SearchViewController *searchVC = [[SearchViewController alloc] init];
    searchVC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:searchVC animated:YES];
}
/** EChart */
- (void)didSelectedEChartButton
{
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"bar" ofType:@"html"];//[[NSBundle mainBundle] pathForResource:@"bar" ofType:@"html" inDirectory:@"ECharts"];
    
    MSWebViewController *webVC = [[MSWebViewController alloc] init];
    webVC.title = @"ECharts";
    webVC.ms_localPath = filePath;
    webVC.hidesBottomBarWhenPushed = YES;
    
    [self.navigationController pushViewController:webVC
                                         animated:YES];
}
/** db */
- (void)didSelectedDBButton
{
    TestViewController8 *VC = [[TestViewController8 alloc] init];
    VC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:VC animated:YES];
}
/** layer实现滑动解锁动画 */
- (void)didSelectedAnimationButton
{
    TestViewController9 *VC = [[TestViewController9 alloc] init];
    VC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:VC animated:YES];
}
/** 转盘抽奖 */
- (void)didSelectedDiviedCircleViewButton
{
    TestViewController10 *VC = [[TestViewController10 alloc] init];
    VC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:VC animated:YES];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
